#ifndef __AX_FORK_H__
#define __AX_FORK_H__
#include <stdbool.h>

/*
 *  util to pass fun and param to new forked process
 */

typedef struct ax_fork ax_fork;

/* will return exit code */
typedef int (*ax_fork_cb)(void*);

ax_fork* ax_fork_create();
void     ax_fork_destroy(ax_fork* f);
bool     ax_fork_run(ax_fork* f, ax_fork_cb cb, void* param);
int      ax_fork_wait(ax_fork* f);
void     ax_fork_kill(ax_fork* f);
#endif
